﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using CrystalDecisions.CrystalReports.Engine;

namespace ContractManagementSystem.Presentation.ReportManagement
{
    public partial class ShowReportClients : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["SOURCE_CLIENT_TABLE"] != null)
            {
                var reportDocument = new ReportDocument();

                reportDocument.Load(Server.MapPath("CrystalReportClient.rpt"));

                var dataTable = (DataTable)Session["SOURCE_CLIENT_TABLE"];
                reportDocument.SetDataSource(dataTable);

                CrystalReportViewerClient.DisplayGroupTree = false;
                CrystalReportViewerClient.ReportSource = reportDocument;
                CrystalReportViewerClient.DataBind();
                CrystalReportViewerClient.RefreshReport();
            }
        }
    }
}
